<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="/">${web_name!}</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
            <#if sessionUser??>
                <li><a class="text-red">${sessionUser.username}</a></li>
            <#else>
                <li><a href="/admin/login">商家登录</a></li>
                <li><a href="/login">登录</a></li>
                <li><a href="/register" class="text-red">去注册</a></li>
            </#if>
            </ul>
            <ul class="nav navbar-nav navbar-right">

            <#if sessionUser??>
                <li><a href="/order/myCar"><span class="icon icon-shopping-cart">&nbsp;</span>我的餐车</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false"><span class="icon icon-user">&nbsp;</span>个人中心 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="/order/myOrder">我的订单</a></li>
                        <li><a <#if !sessionUser?exists>href="/login"<#else> data-toggle="modal" data-target="#memberInfo"</#if>>个人信息</a></li>
                        <li><a href="/food/list?collect=kkk">我的收藏</a></li>
                    </ul>
                </li>
                <li><a href="/logout"><span class="icon icon-shopping-cart">&nbsp;</span>退出登录</a></li>
            </#if>
            </ul>
        </div>
    </div>
</nav>
<div class="content-top col-center-block no-padding">
    <div class="header">
        <div class="ng-header-box">
            <div class="ng-search">
                <form action="/food/list">
                    <i class="icon icon-search"></i>
                    <input type="text" placeholder="搜索餐品" name="name" value="${name!}">
                    <button type="submit">搜索</button>
                </form>
            </div>
        </div>
        <div class="ng-nav-bar">
            <div class="nav pull-left">
                <ul>
                    <#list categoryList as item>
                        <li><a href="/food/list?category=${item.name}">${item.name}</a></li>
                        <li>/</li>
                    </#list>
                </ul>
            </div>
        </div>
    </div>
</div>

<#if sessionUser??>
<div class="modal fade bs-example-modal-sm" id="memberInfo" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">个人信息</h4>
            </div>
            <div class="modal-body">
                <div >
                    <span>用户名：${sessionUser.username!}</span><br/><br/>
                    <span>手机号：${sessionUser.phone!}</span><br/><br/>
                    <span>注册时间：${sessionUser.addtime?string('yyyy-MM-dd HHH:mm:ss')}</span><br/><br/>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-success" data-toggle="modal" data-target="#info">修改密码</button>
            </div>
        </div>
    </div>
</div>
</#if>

<div class="modal fade bs-example-modal-sm" id="info" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">修改密码</h4>
            </div>
            <div class="modal-body">
                <form  class="form-horizontal" >
                    <div class="input-group has-success col-xs-6" style="margin: 10px auto;">
                        <span class="input-group-addon" style="width: 90px;">原&nbsp;密&nbsp;码:</span>
                        <input type="password" class="form-control" name="password">
                    </div>
                    <div class="input-group has-success col-xs-6" style="margin: 10px auto;">
                        <span class="input-group-addon" style="width: 90px;">新&nbsp;密&nbsp;码:</span>
                        <input type="password" class="form-control" name="pwd">
                    </div>
                    <div class="input-group has-success col-xs-6" style="margin: 10px auto;">
                        <span class="input-group-addon" style="width: 90px;">确认密码:</span>
                        <input type="password" class="form-control" name="pwd2">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary" onclick="pwd_submit()">修改</button>
            </div>
        </div>
    </div>
</div>